// C source file with the function definitions to handle Unicode codepoints

// check_unicd_int() function
// function to check if a unicd_int integer is a valid unicode character integer
bool check_unicd_int(unicd_int ch)
{
  if (ch >= MIN_UNICD_INT && ch <= MAX_UNICD_INT)
    return 1;
  return 0;
}

// print_unicd_int() function
byte print_unicd_int(unicd_int ch)
{
  // if invalid
  byte rtn = check_unicd_int(ch);
  if (rtn == 0)
    printf(INV_UNICD_INT_STR);
  else if (ch < 0x100)
    printf("%02llX", ch);
  else if (ch < 0x10000)
    printf("%04llX", ch);
  else
    printf("%06llX", ch);
  return rtn;
}

// unicd_int_equal() function
// function to check if 2 unicd_int integers are the same
bool unicd_int_equal(void * unicd1, void * unicd2)
{
  return ((unicd_int *) unicd1)[0] == ((unicd_int *) unicd2)[0];
}
